<template>
  <div class="home">
      <Header :city="city"> </Header>
      <Wheel :list="swiperList"></Wheel>
      <Nav :iconList="iconList"></Nav>
      <Commond :dataList="recommendList"></Commond>
      <Weekend :weekList="weekendList"></Weekend>
  </div>
</template>

<script>
import Header from './components/Header'
import Wheel from './components/Swiper'
import Nav from './components/Nav'
import Commond from './components/Commond'
import Weekend from './components/Weekend'
import Axios from 'axios'

export default {
  name: 'Home',
  components: {
    Header,
    Wheel,
    Nav,
    Commond,
    Weekend
  },
  methods: {
    getHomeInfoSucc () {
      Axios.get('static/mock/index.json').then((res) => {
        res = res.data
        // console.log(res)
        if (res.ret && res.data) {
          const data = res.data
          this.city = data.city
          this.swiperList = data.swiperList
          this.iconList = data.iconList
          this.recommendList = data.recommendList
          this.weekendList = data.weekendList
        }
      })
    }
  },
  mounted () {
    this.getHomeInfoSucc()
  },
  data () {
    return {
      city: '',
      swiperList: [],
      iconList: [],
      recommendList: [],
      weekendList: []
    }
  }
}
</script>

<style scoped>

</style>
